class Solution
{
public:
    char repeatedCharacter(string s)
    {
        unordered_map<char, int> count;
        for (char c : s)
        {
            ++count[c];
            if (count[c] == 2)
            {
                return c;
            }
        }
        return '\0';
    }
};